package com.sgb.link.entity;

import android.os.Parcel;
import android.os.Parcelable;

import org.jetbrains.annotations.NotNull;

public class AMapAddressEntity implements Parcelable {
    private String province,provinceName;//省
    private String city,cityName;//市
    private String district,districtName;//区
    private String snippet;//详细地址
    private String street;//街道
    private String distance;//距离
    private double latitude;//经度
    private double longitude;//纬度
    private String provinceNo;//省编码
    private String cityNo;//城市编码
    private String districtNo;//区域编码

    //地图找车增加字段：0——表示起点地址    1——表示终点地址
    private int type = 0;
    //省市区全称
    private String allProvince;//省
    private String allCity;//市
    private String allDistrict;//区

    public String getAllProvince() {
        return allProvince;
    }

    public void setAllProvince(String allProvince) {
        this.allProvince = allProvince;
    }

    public String getAllCity() {
        return allCity;
    }

    public void setAllCity(String allCity) {
        this.allCity = allCity;
    }

    public String getAllDistrict() {
        return allDistrict;
    }

    public void setAllDistrict(String allDistrict) {
        this.allDistrict = allDistrict;
    }

    public AMapAddressEntity() {
    }

    public AMapAddressEntity(String city, String cityNo, String provinceNo) {
        this.city = city;
        this.cityNo = cityNo;
        this.provinceNo = provinceNo;
    }

    public AMapAddressEntity(String province, String city, String district, String snippet, String distance, double latitude, double longitude, String provinceNo, String cityNo, String districtNo) {
        this.province = province;
        this.city = city;
        this.district = district;
        this.snippet = snippet;
        this.distance = distance;
        this.latitude = latitude;
        this.longitude = longitude;
        this.provinceNo = provinceNo;
        this.cityNo = cityNo;
        this.districtNo = districtNo;
    }

    public AMapAddressEntity(String province, String city, String district, String snippet,String street, String distance, double latitude, double longitude, String provinceNo, String cityNo, String districtNo) {
        this.province = province;
        this.city = city;
        this.district = district;
        this.snippet = snippet;
        this.street = street;
        this.distance = distance;
        this.latitude = latitude;
        this.longitude = longitude;
        this.provinceNo = provinceNo;
        this.cityNo = cityNo;
        this.districtNo = districtNo;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getSnippet() {
        return snippet;
    }

    public void setSnippet(String snippet) {
        this.snippet = snippet;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public String getProvinceNo() {
        return provinceNo;
    }

    public void setProvinceNo(String provinceNo) {
        this.provinceNo = provinceNo;
    }

    public String getCityNo() {
        return cityNo;
    }

    public void setCityNo(String cityNo) {
        this.cityNo = cityNo;
    }

    public String getDistrictNo() {
        return districtNo;
    }

    public void setDistrictNo(String districtNo) {
        this.districtNo = districtNo;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.province);
        dest.writeString(this.city);
        dest.writeString(this.district);
        dest.writeString(this.snippet);
        dest.writeString(this.distance);
        dest.writeDouble(this.latitude);
        dest.writeDouble(this.longitude);
        dest.writeString(this.provinceNo);
        dest.writeString(this.cityNo);
        dest.writeString(this.districtNo);
        dest.writeInt(this.type);
        dest.writeString(this.cityName);
        dest.writeString(this.provinceName);
        dest.writeString(this.districtName);
        dest.writeString(this.allProvince);
        dest.writeString(this.allCity);
        dest.writeString(this.allDistrict);
        dest.writeString(this.street);
    }

    protected AMapAddressEntity(Parcel in) {
        this.province = in.readString();
        this.city = in.readString();
        this.district = in.readString();
        this.snippet = in.readString();
        this.distance = in.readString();
        this.latitude = in.readDouble();
        this.longitude = in.readDouble();
        this.provinceNo = in.readString();
        this.cityNo = in.readString();
        this.districtNo = in.readString();
        this.type = in.readInt();
        this.cityName=in.readString();
        this.provinceName=in.readString();
        this.districtName=in.readString();
        this.allProvince=in.readString();
        this.allCity=in.readString();
        this.allDistrict=in.readString();
        this.street=in.readString();
    }

    public static final Creator<AMapAddressEntity> CREATOR = new Creator<AMapAddressEntity>() {
        @Override
        public AMapAddressEntity createFromParcel(Parcel source) {
            return new AMapAddressEntity(source);
        }

        @Override
        public AMapAddressEntity[] newArray(int size) {
            return new AMapAddressEntity[size];
        }
    };

    @NotNull
    @Override
    public String toString() {
        return "AMapAddressEntity{" +
                "province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", district='" + district + '\'' +
                ", snippet='" + snippet + '\'' +
                ", distance='" + distance + '\'' +
                ", latitude=" + latitude +
                ", longitude=" + longitude +
                ", provinceNo='" + provinceNo + '\'' +
                ", cityNo='" + cityNo + '\'' +
                ", districtNo='" + districtNo + '\'' +
                '}';
    }
}
